﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml.Linq;
using NextCMS.Models;

/// <summary>
/// Summary description for PageFormController
/// </summary>
public class PageFormsHelper : IPageForm
{
    IPageForm pageForms = null;
    public PageFormsHelper()
    {
        pageForms = (IPageForm)NextCMS.DataAccess.Entities.CreateInstance<IPageForm>();
    }
    public T GetById<T>(int id)
    {
        return pageForms.GetById<T>(id);
    }
    public List<T> GetAll<T>()
    {
        return pageForms.GetAll<T>();
    }
    
    public int Save(IForm page)
    {
        return pageForms.Save(page);
    }
    // Delete Record
    public void Delete(int id)
    {
        pageForms.Delete(id);
    }

    // Edit Record
    public void Edit(IForm page)
    {
        pageForms.Edit(page);
    }

    public void Dispose()
    {
        pageForms.Dispose();
        pageForms = null;
    }
}